package com.you.concurrent.juc.atomic;

import com.sun.corba.se.impl.oa.poa.AOMEntry;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerDemo {

    static AtomicInteger atomicInteger = new AtomicInteger(0);

    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 1000; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    atomicInteger.addAndGet(1);
                }
            }).start();
        }
        Thread.sleep(5000L);
        System.out.println(atomicInteger.get());
    }
}
